import { POST } from '@/api/helper'
import profile from '@root/profile'

const { userCenter } = profile.proxy

export default {
  /**
   * 登录(新)
   */
  // login: (data) => POST({ url: userCenter.prefix + '/login/mobile', data }),
  login: (data) => POST({ url: window.location.pathname + '/mock-data/auth/login.json', data }),

  /**
   * 获取所有字典
   */
  loginQuit: (data) => POST({ url: userCenter.prefix + '/login/quit', data }),

  /**
   * 获取用户信息
   */
  getLoginUserInfo: (data) => POST({ url: userCenter.prefix + '/currentUser/getLoginUserInfo', data }),

  /**
   * 获取所有菜单
   */
  queryMenuListByToken: (data) => POST({ url: userCenter.prefix + '/currentUser/queryMenuListByToken', data }),

  /**
   * 切换部门
   */
  changeDept: (data) => POST({ url: userCenter.prefix + '/currentUser/changeDept', data }),

  /**
   * 获取切换部门列表
   */
  queryBranchByToken: (data) => POST({ url: userCenter.prefix + '/currentUser/queryBranchByToken', data }),

  /**
   * 更改密码
   * @param data
   * @return {Promise<unknown>}
   */
  changePassword: (data) => POST({ url: userCenter.prefix + '/currentUser/changePassword', data }),

  /**
   * 根据手机号 修改密码
   * @param data
   * @return {Promise<unknown>}
   */
  changePasswordByMobile: (data) => POST({ url: userCenter.prefix + '/login/changePasswordByMobile', data }),

  /**
   * 发送验证码
   * @param data
   * @return {Promise<unknown>}
   */
  captchaSms: (data) => POST({ url: userCenter.prefix + '/captcha/sms', data }),

  /**
   * 检验验证码
   * @param data
   * @return {Promise<unknown>}
   */
  captchaSmsCheck: (data) => POST({ url: userCenter.prefix + '/captcha/sms/check', data }),

  /**
   * 第一次 更新用户密码
   */
  updatePersonalFirstPswV1: (data) => POST({ url: userCenter.prefix + '/currentUser/resetPassword', data }),

  /**
   * 更新当前用户密码
   */
  updatePersonalPswV1: (data) => POST({ url: userCenter.prefix + '/currentUser/changePassword', data })
}
